#include<bits/stdc++.h>
using namespace std;
int main()
{
	int temp,v;
	cin>>temp>>v;
	cout<<abs(temp-25)+abs(v-2)<<endl;
	return 0;
}
